package ru.dadle8.repository;

import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import ru.dadle8.model.db.Workout;

import java.util.List;
import java.util.Optional;

public interface WorkoutRepository extends MongoRepository<Workout, String>, PagingAndSortingRepository<Workout, String> {

    Optional<Workout> findByMessageId(Integer messageId);

    List<Workout> findByTitleContainsIgnoreCaseOrTagsContainingIgnoreCase(String title, List<String> tags);
}
